<?php if (!defined('NOVA_RUN')) die('You can\'t access this file directly!');

/*
-------------------------------------------------------
*
*   NovaBoard 2
*   Copyright © 2011 NovaBoard team
*
*--------------------------------------------------------
*
*   Official site: www.novaboard.net
*   Contact e-mail: support@novaboard.net
*
*   GNU General Public License, version 2:
*   http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*
---------------------------------------------------------
*/

class tpl
{
	protected static $instance;
	private $tplFolder;
	
	public static function instance()
	{
		if (!(self::$instance instanceof tpl))
		{
			self::$instance = new tpl();
		}

		return self::$instance;
	}

	public function __construct()
	{
		$this->tplFolder = (defined('NOVA_ADMIN')) ? ROOT . 'templates/admin/' : ROOT . 'templates/';
		$this->model = new Template_Model();
	}
	
	function assign($name, $value)
	{
		$this->$name = $value;
	}

	function show($tpl)
	{
		require $this->tplFolder . $tpl . '.php';
	}

	function load($tpl)
	{
		require $this->tplFolder . $tpl . '.php';
	}
}
